<style>
	.jiahao{height:10px;width:10px;margin-right:5px;}
	.nav-top-item+ul{display: none}
	.nav-top-item+ul ul{display:none;}
	#iframe_content{width:100%;height:100%;}
	#main-content{}
	.contentCate ul{display: none}
	</style>
	<div id="body-wrapper"> 
		<div id="sidebar"><div id="sidebar-wrapper">
			<h1 id="sidebar-title"><a href="#">后台管理</a></h1>
<!-- 			<a href="#"><img id="logo" src="__IMG__logo.png" alt="Simpla Admin logo" /></a> -->
			<div id="profile-links"  style="margin-top:20px;">
				Welcome，<a href="javascript:" title="Edit your profile">{:session('user_id')}</a>,你有<a href="#messages" rel="modal" title="3 Messages">3 条</a>消息<br />
				<br />
				<a href="{:C('web_path')}"  target="_block" title="网站首页">网站首页</a> |<a href="javascript:" title="清空缓存" id="deleteCache">清空缓存</a> |  <a href="/admin/login/logout" title="退出">退出</a>
			</div>        
			<?php 
					function cateUl($data,$type=0){
								?>
								<ul     class="contentCate" >
								<?php foreach ($data as $r){?>
									<li>
									<a href="javascript:"  <?php if(!is_array($r['son'])){?>  onclick="iframe_a(<?php echo $r['id'];?>);"  <?php }else{?>  onclick="show_ul(this);"   <?php }?>  >
									<?php if(is_array($r['son'])){?>
											<img src="__IMG__toggle-expand.png"  class="jiahao" />
											<?php }else{?>
													<img src="__IMG__article.png"  class="jiahao" />
												<?php }?>
									{$r['name']}
									</a>
									<?php  if(is_array($r['son'])){cateUl($r['son'],1);}?>
									</li>
									<?php }?>
								</ul>
								<?php }?>
								<script>
								</script>
			<ul id="main-nav"> 
				<li>
					<a href="javascript:" class="nav-top-item  current" >
						网站基本设置
					</a>      
					<ul style="display:block;">
						<li><a href="javascript:"  onclick="iframe_a('/admin/WebSet/index');" class="current" ><img src="__IMG__article.png"  class="jiahao " />网站信息</a></li>
						<li><a href="javascript:"  onclick="iframe_a('/admin/WebSet/baseset');" ><img src="__IMG__article.png"  class="jiahao" />基本设置</a></li>
					</ul> 
				</li>				
				<li> 
					<a href="javascript:" class="nav-top-item" > 
					内容管理
					</a>				
					<?php cateUl($arr);?>
				</li>
				<li>
					<a href="javascript:" class="nav-top-item" >
						栏目管理
					</a>
					<ul>
						<li><a href="javascript:"   onclick="iframe_a('/admin/WebSet/cate');"><img src="__IMG__article.png"  class="jiahao" />栏目列表</a></li>
						<li><a href="javascript:"   onclick="iframe_a('/admin/position/index');"><img src="__IMG__article.png"  class="jiahao" />推荐位列表</a></li>
					<?php if(session("user_group")==10){ ?>
						<li><a href="javascript:"   onclick="iframe_a('/admin/models/model');"><img src="__IMG__article.png"  class="jiahao" />模型列表</a></li>
				<?php }?>
					</ul>
				</li>
				
				
				<li>
					<a href="javascript:" class="nav-top-item" >
						网站管理
					</a>
					<ul>
						<li><a href="javascript:"  onclick="iframe_a('/admin/recruitment/index');"><img src="__IMG__article.png"  class="jiahao" />职位列表</a></li>
						<li><a href="javascript:"  onclick="iframe_a('/admin/link/index');"><img src="__IMG__article.png"  class="jiahao" />友情链接列表</a></li>
						<li><a href="javascript:"  onclick="iframe_a('/admin/adver');"><img src="__IMG__article.png"  class="jiahao" />广告列表</a></li>
						<!--  <li><a href="javascript:"  onclick="iframe_a('/admin/adver/img');"><img src="__IMG__article.png"  class="jiahao" />图片列表</a></li>-->
						<li><a href="javascript:"  onclick="iframe_a('/admin/page/index');"><img src="__IMG__article.png"  class="jiahao" />单页列表</a></li>
						<li><a href="javascript:"  onclick="iframe_a('/admin/search/lists');"><img src="__IMG__article.png"  class="jiahao" />搜索列表</a></li>
						<li><a href="javascript:"  onclick="iframe_a('/admin/message/lists');"><img src="__IMG__article.png"  class="jiahao" />留言板</a></li>
					</ul>
				</li>
				<li>
					<a href="javascript:" class="nav-top-item" >
						用户管理
					</a>
					<ul>
						<li>	<a href="javascript:"  onclick="show_ul(this);"><img src="__IMG__toggle-expand.png"  class="jiahao" />用户列表</a>
						<ul>
						<li><a href="javascript:"  onclick="iframe_a('/admin/user/user');" ><img src="__IMG__article.png"  class="jiahao" />后台管理员</a></li>
						<li><a href="javascript:" onclick="iframe_a('/admin/users/index');" ><img src="__IMG__article.png"  class="jiahao" />网站用户</a></li>
						</ul>
						</li>
						<li  >	<a href="javascript:"  onclick="show_ul(this);"><img src="__IMG__toggle-expand.png"  class="jiahao" />权限管理</a>
						<ul>
						<li><a href="javascript:"  ><img src="__IMG__article.png"  class="jiahao" />管理员</a></li>
						<li><a href="javascript:"  ><img src="__IMG__article.png"  class="jiahao" />新人</a></li>
						</ul>
						</li>
					</ul>
				</li>      
			</ul>
		</div></div>
		<div id="main-content"> 
		<iframe id="iframe_content" src="/admin/WebSet/index"   frameborder="0" scrolling="auto" ></iframe>
		</div> 
	</div>
	<script>

	$(function(){
		$("#main-nav li ul a").click(function(){
			$("#main-nav li ul a").removeClass("current");
			$(this).addClass("current");
			});
		$("#main-nav li>a").click(function(){
			$("#main-nav li>a").removeClass("current");
			$(this).addClass("current");
			});
				//清除缓存
		$("#deleteCache").click(function(){
			$.post("/admin/WebSet/deleteCache",{},function(data){
				
				if(data){
					location.reload(true);
					}else{
						alert("删除失败！");
						}
					});
			});
		});
	
			//内容管理    更改iframe src
		function iframe_a(cateid){
			var w=$(window).width();
			$("#main-content").css("width",w-250);
		   if(!isNaN(cateid)){
			   cateid="/admin/WebSet/article?cate_id="+cateid;
			   }
			$("#iframe_content").attr('src',cateid);
			}

		//展开二级子栏目
		function show_ul(obj){
			var img=$(obj).find("img");
			var par_ul=$(obj).parent().find(">ul");
				if(par_ul.is(":hidden")){
						$(img).attr("src","/Public/images/round_remove.png");
					}else{
						$(img).attr("src","/Public/images/toggle-expand.png");
						}
				par_ul.stop(true,true).slideToggle();
			}
</script>